package com.springboot01.service;

import com.springboot01.dao.EmployeeDao;
import entity.EmployeeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {
    @Autowired
    private EmployeeDao employeeDao;
    public List<EmployeeEntity> findAll(){
        return employeeDao.findAll();
    }

    public EmployeeEntity findEmployeeById(Integer id){
        return employeeDao.findEmployeeEntitiesById(id);
    }

    public EmployeeEntity save(EmployeeEntity emp){
        return employeeDao.save(emp);
    }

    public EmployeeEntity update(EmployeeEntity emp){
        return null;
    }

    public void delete(Integer id){
        employeeDao.deleteById(id);
    }
}
